//
//  SXBaseTableViewController.swift
//  sina
//
//  Created by shengxinwei on 16/5/20.
//  Copyright © 2016年 shengxinwei. All rights reserved.
//

import UIKit

class SXBaseTableViewController: UITableViewController , SXVisitorViewDelegate {
    //判断有无登陆注册
    var visitorTure = SXUserAccountViewModel.sharedAccount.userLogin
    //创建访客对象
    lazy var visitorView: SXVisitorView = SXVisitorView()
    
    override func loadView() {
        if visitorTure == false{
            loadVisitorView()
        }else{
            super.loadView()
        }
    }
    
    func loadVisitorView() {
        let v = visitorView
        v.backgroundColor = UIColor.init(red: 237/255.0, green: 237/255.0, blue: 237/255.0, alpha: 1)
        view  = v
        v.visitorDelegate = self
    }
    
    func requiredResigter() {
        print("注册")
    }
    
    func requiredLogin() {
        let oauthVc = SXOAuthViewController()
        let nav = UINavigationController(rootViewController: oauthVc)
        presentViewController(nav, animated: true, completion: nil)
    }
    
    

    
}
